package com.example.demo.adapter;

/**
 * @Description
 * @Author youxin
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2022/1/11
 */
public class VoltageAdapter implements Voltage5v{
    private Voltage220v voltage220v;
    VoltageAdapter(Voltage220v voltage220v){
        this.voltage220v=voltage220v;
    }

    @Override
    public int output5v() {
        int rs = voltage220v.output220v();
        System.out.println("使用对象适配器 进行适配");
        rs=rs/44;
        System.out.println("适配完成，输送电压为："+rs);
        return rs;
    }
}
